import { FilterConst } from "../../component/gconst/FilterConst";
import { LineBox } from "../view/guide/LineBox";
import { ObjectPool } from "../../../com/gengine/utils/pools/ObjectPool";
import { GlowFilterEffect } from "../view/effect/GlowFilterEffect";
import { FlashMaskEffect } from "../view/effect/FlashMaskEffect";
import { UIMaskEffect } from "../view/effect/UIMaskEffect";
type int = number;
//class EffectManager
    
    export  class EffectManager
    {
        

        public static glowFilterReg(arg1: Object /* flash.display.DisplayObject */, arg2: Array<any>=null, arg3: number=1, arg4: int=10, arg5: int=0, arg6: int=0): void
        {
            if (arg2 == null) 
            {
                arg2 = [FilterConst.guideTipsFilter];
            }
            EffectManager._glowFilter.regist(arg1, arg2, arg3, arg4, arg5, arg6);
            return;
        }

        public static glowFilterUnReg(arg1: Object /* flash.display.DisplayObject */): void
        {
            EffectManager._glowFilter.unRegist(arg1);
            return;
        }

        public static getGlowFilters(arg1: Object /* flash.display.DisplayObject */): Array<any>
        {
            return EffectManager._glowFilter.getFilters(arg1);
        }

        public static getLineBox(arg1: int, arg2: int, arg3: Array<any>=null, arg4: number=0.5, arg5: number=1, arg6: number=1): LineBox
        {
            var loc1=ObjectPool.getObject(LineBox);
            if (arg3 == null) 
            {
                arg3 = [16711680, 16776960];
            }
            loc1.updateLine(arg1, arg2, arg3, arg4, arg5, arg6);
            return loc1;
        }

        public static disposeLineBox(arg1: LineBox): void
        {
            if (!arg1) 
            {
                return;
            }
            arg1.dispose();
            ObjectPool.disposeObject(arg1, LineBox);
            return;
        }

        public static flashMaskReg(arg1: Object /* flash.display.DisplayObject */, arg2: Object /* flash.display.DisplayObjectContainer */, arg3: int, arg4: int): void
        {
            EffectManager._flashMaskEffect.regFlashMask(arg1, arg2, arg3, arg4);
            return;
        }

        public static flashMaskUnReg(arg1: Object /* flash.display.DisplayObject */): void
        {
            EffectManager._flashMaskEffect.unRegFlashMask(arg1);
            return;
        }

        public static flashMaskUnRegAll(): void
        {
            EffectManager._flashMaskEffect.unRegAll();
            return;
        }

        public static addUIMask(arg1: Array<any>, arg2: int=10000, arg3: number=0.3, arg4: Function=null): void
        {
            EffectManager._uiMaskEffect.showMask(arg1, arg2, arg3, arg4);
            return;
        }

        public static hideUIMask(): void
        {
            EffectManager._uiMaskEffect.hideMask();
            return;
        }

        public static hasUIMask(): Boolean
        {
            return !EffectManager._uiMaskEffect.isHide;
        }

        public static stageResize(): void
        {
            EffectManager._uiMaskEffect.stageResize();
            return;
        }

        public static getLightMask(arg1: number, arg2: number): LightMask
        {
            var loc1=ObjectPool.getObject(LightMask);
            loc1.transform.matrix = new Object /* flash.geom.Matrix */();
            loc1.scaleX = arg1 / 42.5;
            loc1.scaleY = arg2 / 42.5;
            return loc1;
        }

        public static disposeLightMask(arg1: LightMask): void
        {
            if (arg1) 
            {
                if (arg1.parent) 
                {
                    arg1.parent.removeChild(arg1);
                }
                arg1.x = 0;
                arg1.y = 0;
                arg1.width = 40;
                arg1.height = 40;
                ObjectPool.disposeObject(arg1);
            }
            return;
        }

        /* internal */ static /* var */_glowFilter: GlowFilterEffect;

        /* internal */ static /* var */_flashMaskEffect: FlashMaskEffect;

        /* internal */ static /* var */_uiMaskEffect: UIMaskEffect;
    }

            EffectManager._glowFilter = new GlowFilterEffect();
            EffectManager._flashMaskEffect = new FlashMaskEffect();
            EffectManager._uiMaskEffect = new UIMaskEffect();
        